import 'package:color_dart/RgbaColor.dart';
import "package:flutter/material.dart";
import 'package:im_flutter_sdk_example/components/a_button/index.dart';
import 'package:im_flutter_sdk_example/utils/global.dart';
import 'package:im_flutter_sdk_example/utils/screen.dart';

class LabelRenzheng extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(left: 10),
      child: SizedBox(
          child: Image.asset("lib/assets/images/label/label-renzheng.png",
              fit: BoxFit.contain),
          width: 47,
          height: 18),
    );
  }
}

// label-baoming

class LabelBaoMing extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(left: 10),
      child: SizedBox(
          child: Image.asset("lib/assets/images/label/label-baoming.png",
              fit: BoxFit.contain),
          width: 49,
          height: 22),
    );
  }
}

//头部推荐标题
class LabelMoreHead extends StatelessWidget {
  final address;
  const LabelMoreHead({Key key, this.address}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.fromLTRB(17, 13, 17, 13),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          LabelImgTitle(address: '$address'),
          Text(
            '查看更多',
            style: TextStyle(color: rgba(191, 191, 191, 1), fontSize: 12),
          )
        ],
      ),
    );
  }
}

// label-over

class LabelOver extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(left: 10),
      child: SizedBox(
          child: Image.asset("lib/assets/images/label/label-over.png",
              fit: BoxFit.contain),
          width: 49,
          height: 22),
    );
  }
}

//label-img-title

class LabelImgTitle extends StatelessWidget {
  final address;
  LabelImgTitle({Key key, this.address}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: 59,
      height: 24,
      child: Image.asset(
        '$address',
        fit: BoxFit.cover,
      ),
    );
  }
}

//首页项目标签
class LabelHomeProject extends StatelessWidget {
  final name;
  const LabelHomeProject({Key key, this.name}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      color: rgba(239, 247, 245, 1),
      margin: EdgeInsets.only(right: 6),
      padding: EdgeInsets.fromLTRB(4, 1, 4, 1),
      child: Text(
        '$name',
        style: TextStyle(color: rgba(0, 177, 144, 1), fontSize: 11),
      ),
    );
  }
}

//项目专家标签
class LabelProject extends StatelessWidget {
  final name;
  const LabelProject({Key key, this.name}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      color: rgba(232, 243, 255, 1),
      margin: EdgeInsets.only(right: 6),
      constraints: BoxConstraints(
        maxWidth: G.screenWidth() * 0.7,
      ),
      padding: EdgeInsets.fromLTRB(4, 1, 4, 1),
      child: Text(
        '$name',
        maxLines: 1,
        overflow: TextOverflow.ellipsis,
        style: TextStyle(color: rgba(97, 142, 210, 1), fontSize: 22.nsp),
      ),
    );
  }
}

//项目专家标签
class LabelExpertDetail extends StatelessWidget {
  final name;
  const LabelExpertDetail({Key key, this.name}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      color: rgba(253, 243, 214, 1),
      margin: EdgeInsets.only(right: 6),
      padding: EdgeInsets.fromLTRB(4, 1, 4, 1),
      child: Text(
        '$name',
        style: TextStyle(color: rgba(192, 127, 4, 1), fontSize: 11),
      ),
    );
  }
}

//项目收藏标签
class LabelCollect extends StatelessWidget {
  final name;
  const LabelCollect({Key key, this.name}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      color: rgba(250, 244, 231, 1),
      margin: EdgeInsets.only(right: 6),
      padding: EdgeInsets.fromLTRB(4, 1, 4, 1),
      child: Text(
        '$name',
        style: TextStyle(color: rgba(255, 102, 0, 1), fontSize: 11),
      ),
    );
  }
}

class LabelKwdNews extends StatelessWidget {
  final name;
  const LabelKwdNews({Key key, this.name}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
          color: rgba(237, 241, 247, 0.69),
          borderRadius: BorderRadius.all(Radius.circular(10))),
      margin: EdgeInsets.only(right: 6),
      padding: EdgeInsets.fromLTRB(4, 1, 4, 1),
      child: Text(
        '$name',
        style: TextStyle(color: rgba(72, 107, 157, 1), fontSize: 12),
      ),
    );
  }
}

// label-teyao

class LabelTeyao extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: const EdgeInsets.only(left: 10),
      child: SizedBox(
          child: Image.asset("lib/assets/images/label/label-teyao.png",
              fit: BoxFit.contain),
          width: 47,
          height: 18),
    );
  }
}

// vip-level

class LabelVipLeavel extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SizedBox(
        child: Image.asset("lib/assets/images/comment/vip_level.png",
            fit: BoxFit.contain),
        width: 47,
        height: 18);
  }
}

// vip-level

class LabelThumbsUp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SizedBox(
        child: Image.asset("lib/assets/images/comment/thumbs_up.png",
            fit: BoxFit.contain),
        width: 14,
        height: 14);
  }
}

// 为你推荐

class LabelSimlarRecommend extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SizedBox(
      child: Container(
        color: rgba(249, 249, 249, 1),
        height: 60,
        child: Padding(
          padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              SizedBox(
                width: 200,
                height: 18,
                child: Image.asset(
                  "lib/assets/images/recommend_sign.png",
                  fit: BoxFit.fill,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

// 已加载全部

class LabelLoadAll extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SizedBox(
      child: Container(
        color: rgba(255, 255, 255, 1),
        child: Row(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Container(
              height: 1,
              width: 16,
              color: rgba(245, 245, 245, 1),
            ),
            Padding(
              padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
              child: Text(
                '已加载全部',
                style: TextStyle(
                  fontSize: 11,
                  color: rgba(163, 163, 163, 1),
                ),
              ),
            ),
            Container(
              height: 1,
              width: 16,
              color: rgba(245, 245, 245, 1),
            ),
          ],
        ),
        height: 58,
      ),
    );
  }
}

// 底部label自定义内容
class LabelFooter extends StatelessWidget {
  final title;
  const LabelFooter({Key key, this.title}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return SizedBox(
      child: Container(
        color: rgba(245, 245, 245, 1),
        child: Padding(
          padding: const EdgeInsets.all(21),
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Container(
                height: 1,
                width: 80,
                color: rgba(216, 216, 216, 1),
              ),
              Padding(
                padding: EdgeInsets.fromLTRB(8, 0, 8, 0),
                child: Text(
                  '$title',
                  strutStyle: StrutStyle(forceStrutHeight: true, height: 1.2),
                  style: TextStyle(
                    color: rgba(163, 163, 163, 1),
                  ),
                ),
              ),
              Container(
                height: 1,
                width: 80,
                color: rgba(216, 216, 216, 1),
              ),
            ],
          ),
        ),
        height: 60,
      ),
    );
  }
}
// 已显示全部评论

class LabelLoadAllComment extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SizedBox(
      child: Container(
        color: rgba(255, 255, 255, 1),
        child: Padding(
          padding: const EdgeInsets.all(21),
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Padding(
                padding: EdgeInsets.fromLTRB(8, 0, 8, 0),
                child: Text(
                  '已显示全部评论',
                  style: TextStyle(
                    color: rgba(163, 163, 163, 1),
                  ),
                ),
              )
            ],
          ),
        ),
        height: 60,
      ),
    );
  }
}

class LabelTuijian extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return SizedBox(
        child: Image.asset("lib/assets/images/label/label-tuijian.png",
            fit: BoxFit.contain),
        width: 47,
        height: 18);
  }
}

class LabelExpert extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(right: 6),
      child: AButton.normal(
          height: 16,
          width: 29,
          color: rgba(166, 123, 5, 1),
          bgColor: rgba(249, 238, 208, 1),
          child: Text(
            '专家',
            style: TextStyle(fontSize: 10),
            textAlign: TextAlign.center,
          ),
          type: 'primary',
          plain: true,
          onPressed: () {}),
    );
  }
}

class LabelAgent extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.only(right: 6),
      child: AButton.normal(
          height: 16,
          width: 37,
          color: rgba(25, 109, 236, 1),
          borderColor: rgba(25, 109, 236, 1),
          child: Text(
            '经纪人',
            style: TextStyle(fontSize: 10),
            textAlign: TextAlign.center,
          ),
          type: 'primary',
          plain: true,
          onPressed: () {}),
    );
  }
}

class LabelTitle extends StatelessWidget {
  final String title;

  const LabelTitle({Key key, this.title}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    Color c1 = Color.fromRGBO(42, 125, 250, 0.44);
    Color c2 = Color.fromRGBO(42, 125, 250, 0);

    TextStyle textActive = new TextStyle(
        fontSize: 22,
        fontWeight: FontWeight.bold,
        color: Color.fromRGBO(51, 51, 51, 1));

    return Stack(
      children: [
        Text('$title', textAlign: TextAlign.left, style: textActive),
        Positioned(
          bottom: 6,
          child: Container(
            height: 8,
            width: 50,
            decoration: BoxDecoration(
                gradient: LinearGradient(
                    begin: Alignment.centerLeft,
                    end: Alignment.centerRight,
                    colors: [c1, c2])),
          ),
        )
      ],
    );
  }
}

class LabelTitleDetail extends StatelessWidget {
  final String title;

  const LabelTitleDetail({Key key, this.title}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Text('$title',
            style: TextStyle(
                color: rgba(51, 51, 51, 1),
                fontSize: 15,
                fontWeight: FontWeight.bold)),
        Container(
          height: 3,
          width: 30,
          color: rgba(42, 125, 250, 1),
        )
      ],
    );
  }
}

class LabelMore extends StatelessWidget {
  const LabelMore({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      color: rgba(243, 247, 255, 1),
      width: 343,
      height: 42,
      alignment: Alignment.center,
      child: Text('查看更多',
          style: TextStyle(
            color: rgba(42, 125, 250, 1),
            fontSize: 14,
          )),
    );
  }
}
